<template>

	<view class="container">
		<!-- <u-subsection  :list="list" :current="curNow" @change="sectionChange"></u-subsection> -->
		<uni-section title="3D" type="line" padding> <span> </span>
			<view class="uni-flex uni-row"
				style="-webkit-justify-content: space-between;justify-content: space-between;">

				<view class="text">
					<view class="example-body">
						<view>
							<u-picker :show="showQiHao" :columns="qiHaoList" @confirm="confirm" itemHeight='50'>
							</u-picker>
							<view class="u-demo-block">
								<u--form>
									<u-form-item label="杀号期数:" prop="qiHaoMeg" borderBottom
										@click="showQiHao = true; showQiHaoTtrue()" labelWidth="80" ref="item3">
										<u--input v-model="qiHaoMeg" disabled disabledColor="#ffffff" placeholder="历史期号"
											border="none"></u--input>
									</u-form-item>
								</u--form>
							</view>
						</view>
					</view>
				</view>
				<view class="text">
					<view class="example-body">
						<view>
							<u-picker :show="showBiKai" :columns="bikaiList" @confirm="confirmBiKai" itemHeight='50'>
							</u-picker>
							<view class="u-demo-block">
								<u--form>
									<u-form-item label="预出号码:" prop="BiKaiMeg" borderBottom
										@click="showBiKai = true; showBiKaiTrue()" labelWidth="80" ref="item3">
										<u--input v-model="BiKaiMeg" disabled disabledColor="#ffffff" placeholder="预出号码"
											border="none"></u--input>
									</u-form-item>
								</u--form>
							</view>
						</view>
					</view>
				</view>

			</view>

			<view class="">
				<u--form>
					<u-form-item label="选号杀码:" borderBottom labelWidth="80" ref="item3">
						<uni-badge class="uni-badge-left-margin" :inverted=clickLin text="0" type="success"
							@click="clickCardLin" />
						<uni-badge class="uni-badge-left-margin" :inverted=clickYi text="1" type="success"
							@click="clickCardYi" />
						<uni-badge class="uni-badge-left-margin" :inverted=clickEr text="2" type="success"
							@click="clickCardEr" />
						<uni-badge class="uni-badge-left-margin" :inverted=clickSan text="3" type="success"
							@click="clickCardSan" />
						<uni-badge class="uni-badge-left-margin" :inverted=clickSi text="4" type="success"
							@click="clickCardSi" />
						<uni-badge class="uni-badge-left-margin" :inverted=clickWu text="5" type="success"
							@click="clickCardWu" />
						<uni-badge class="uni-badge-left-margin" :inverted=clickLiu text="6" type="success"
							@click="clickCardLiu" />
						<uni-badge class="uni-badge-left-margin" :inverted=clickQi text="7" type="success"
							@click="clickCardQi" />
						<uni-badge class="uni-badge-left-margin" :inverted=clickBa text="8" type="success"
							@click="clickCardBa" />
						<uni-badge class="uni-badge-left-margin" :inverted=clickJiu text="9" type="success"
							@click="clickCardJiu" />
					</u-form-item>
				</u--form>
			</view>
			<view class="u-demo-block">
				<u-row>
					<u-col span="6">
						<u--form>
							<u-form-item label="百位:" borderBottom>
								<text class="u-block__title"></text>
								<view class="u-demo-block__content">
									<view class="u-page__radio-item">
										<u-radio-group placement="row">
											<u-radio :customStyle="{marginRight: '8px'}"
												v-for="(item, index) in radiolist6" :key="index" :label="item.name"
												:name="item.falg" @change="radioChangeBwei">
											</u-radio>
										</u-radio-group>
									</view>
								</view>
							</u-form-item>
						</u--form>
					</u-col>
					<u-col span="6">
						<u--form>
							<u-form-item label="十位:" borderBottom>
								<text class="u-block__title"></text>
								<view class="u-demo-block__content">
									<view class="u-page__radio-item">
										<u-radio-group placement="row">
											<u-radio :customStyle="{marginRight: '8px'}"
												v-for="(item, index) in radiolist6" :key="index" :label="item.name"
												:name="item.falg" @change="radioChangeSwei">
											</u-radio>
										</u-radio-group>
									</view>
								</view>
							</u-form-item>
						</u--form>
					</u-col>

				</u-row>

			</view>
			<view>
				<u-row>
					<u-col span="6">
						<u-picker :show="showChongHao" :columns="chonghaoList" @confirm="confirmChongHao"
							itemHeight='50'>
						</u-picker>
						<u--form>
							<u-form-item label="重号次数:" prop="ChongHaoMeg" borderBottom
								@click="showChongHao = true; showChongHaoTrue()" labelWidth="80" ref="item3">
								<u--input v-model="ChongHaoMeg" disabled disabledColor="#ffffff" placeholder="选择重号次数"
									border="none"></u--input>
							</u-form-item>
						</u--form>
					</u-col>
					<u--form>
						<u-form-item label="个位:" borderBottom>
							<text class="u-block__title"></text>
							<view class="u-demo-block__content">
								<view class="u-page__radio-item">
									<u-radio-group placement="row">
										<u-radio :customStyle="{marginRight: '8px'}" v-for="(item, index) in radiolist6"
											:key="index" :label="item.name" :name="item.falg" @change="radioChangeGwei">
										</u-radio>
									</u-radio-group>
								</view>
							</view>
						</u-form-item>
					</u--form>
				</u-row>
			</view>
			<view class="uni-padding-wrap uni-common-mt">
				<button type="primary" @click="submit">开始分析</button>
			</view>
		</uni-section>
		<uni-section title="只有对子" type="line" padding v-if=" yesNumbList[0]">
			<span v-for="site in yesNumbList">
				<text>{{ "    "+site+"    " }},</text>
			</span>
		</uni-section>
		<uni-section title="没有对子" type="line" padding v-if=" noNumbList[0]">
			<span v-for="site in noNumbList"> <text>{{ "    "+site+"    " }},</text></span>
		</uni-section>
		<uni-section title="某个号码必开的集合" type="line" padding v-if=" numbfonum[0]">
			<span v-for="site in numbfonum"> <text>{{ "    "+site+"    " }},</text></span>
		</uni-section>

		<uni-section title="重号开出的集合" type="line" padding v-if=" chongHaoListRes[0]">
			<span v-for="site in chongHaoListRes"> <text>{{ "    "+site+"    " }},</text></span>
		</uni-section>


		<u-notify ref="uNotify"></u-notify>


	</view>
</template>

<script>
	export default {
		components: {},
		data() {
			return {
				title3D: "3D",
				show: false,
				qiHaoMeg: '',
				showQiHao: false, //期号的下拉框
				showBiKai: false, //必开下拉
				showChongHao: false, //重号下拉
				ChongHaoMeg: '3',
				BiKaiMeg: '',
				qiHaoList: [
					['500', '800', '1100', '1500', '1800', '2200', '2500', '0']
				],
				title: 'navigator',
				yesNumbList: [],
				noNumbList: [],
				numbfonum: [],
				chongHaoListRes: [],
				value: 'adasdasdas',
				bikaiList: [
					['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']
				],
				chonghaoList: [
					['1', '2', '3', '4', '5', '6']
				],
				QuerySanDReq: {
					nubm: '', //必开的某个号
					ShaNubm: [], //杀号*
					qishu: '', //查询的期数
					chongHaiCiShu: '',
				},
				//横向排列形式数据
				ResOdd: '偶',
				baiWeiResOdd:'',
				shiWeiResOdd:'',
				geWeiResOdd:'',
				radiolist6: [{
						name: '偶',
						falg: '2',
						disabled: false
					},
					{
						name: '奇',
						falg: '1',
						disabled: false
					}
				],
				clickLin: true,
				nubmLin: "",

				clickYi: true,
				nubmYi: "",

				clickEr: true,
				nubmEr: "",

				clickSan: true,
				nubmSan: "",

				clickSi: true,
				nubmSi: "",

				clickWu: true,
				nubmWu: "",

				clickLiu: true,
				nubmLiu: "",

				clickQi: true,
				nubmQi: "",

				clickBa: true,
				nubmBa: "",

				clickJiu: true,
				nubmJiu: "",

				list: ['3D', '排列3'],
				curNow: 0

			};
		},
		methods: {
			sectionChange(index) {
				this.curNow = index;
				if (index == 1) {
					this.title3D = "排列3"
				}
				if (index == 0) {
					this.title3D = "3D"
				}

			},

			confirmChongHao(e) {
				this.showChongHao = false
				this.ChongHaoMeg = e.value + ''
			},
			confirmBiKai(e) {
				this.showBiKai = false
				this.BiKaiMeg = e.value + ''
			},
			// 回调参数为包含columnIndex、value、values
			confirm(e) {
				this.showQiHao = false
				this.qiHaoMeg = e.value + ''
			},
			showChongHaoTrue() {
				uni.hideKeyboard(); //隐藏软键盘
				this.showChongHao = true
			},
			showBiKaiTrue() {
				uni.hideKeyboard(); //隐藏软键盘
				this.showBiKai = true
			},
			showQiHaoTtrue() {
				uni.hideKeyboard(); //隐藏软键盘
				this.showQiHao = true
			},
			async submit() {

				if (this.qiHaoMeg != "") {
					uni.showLoading({ //开启动画
						title: '分析中' //动画提示文字
					});
					this.QuerySanDReq.qishu = this.qiHaoMeg
					if (this.ChongHaoMeg != "") {
						this.QuerySanDReq.chongHaiCiShu = this.ChongHaoMeg
					}
					if (this.BiKaiMeg != "") {
						this.QuerySanDReq.nubm = this.BiKaiMeg
					}
					if (this.nubmLin != "") {
						this.QuerySanDReq.ShaNubm.push(this.nubmLin)
					}
					if (this.nubmYi != "") {
						this.QuerySanDReq.ShaNubm.push(this.nubmYi)
					}
					if (this.nubmEr != "") {
						this.QuerySanDReq.ShaNubm.push(this.nubmEr)
					}
					if (this.nubmSan != "") {
						this.QuerySanDReq.ShaNubm.push(this.nubmSan)
					}
					if (this.nubmSi != "") {
						this.QuerySanDReq.ShaNubm.push(this.nubmSi)
					}
					if (this.nubmWu != "") {
						this.QuerySanDReq.ShaNubm.push(this.nubmWu)
					}
					if (this.nubmLiu != "") {
						this.QuerySanDReq.ShaNubm.push(this.nubmLiu)
					}
					if (this.nubmQi != "") {
						this.QuerySanDReq.ShaNubm.push(this.nubmQi)
					}
					if (this.nubmBa != "") {
						this.QuerySanDReq.ShaNubm.push(this.nubmBa)
					}
					if (this.nubmJiu != "") {
						this.QuerySanDReq.ShaNubm.push(this.nubmJiu)
					}


					//发起post
					uni.request({
						//url:  'http://114.132.55.180:443/sand/chart/selectSanD/coldHot', 
						url: 'http://114.132.55.180:443/sand/chart/selectSanD/coldHot',
						header: {
							'content-type': 'application/x-www-form-urlencoded'
						},
						data: {
							qishu: this.QuerySanDReq.qishu,
							nubm: this.QuerySanDReq.nubm,
							ShaNubm: this.QuerySanDReq.ShaNubm,
							chongHaoNubm: this.QuerySanDReq.chongHaiCiShu,
							baiWeiResOdd:this.baiWeiResOdd,
							shiWeiResOdd:this.shiWeiResOdd,
							geWeiResOdd:this.geWeiResOdd,
						},
						method: 'POST',

						success: (res) => {
							uni.hideLoading(); //动画关闭
							this.yesNumbList = res.data.yesNumbList
							this.noNumbList = res.data.noNumbList
							this.numbfonum = res.data.numbfonum
							this.chongHaoListRes = res.data.chongList
							if (res.data.success) {

							} else {}

						},
						fail: (res) => {

						}
					});
					this.QuerySanDReq.ShaNubm = []
				} else {
					this.$refs.uNotify.show({
						top: 20,
						message: '查询条件期号不能为空，请选择！',
						type: 'error',
						color: '#ffffff',
						bgColor: '',
						fontSize: 14,
						duration: 1500,
						safeAreaInsetTop: true
					})

				}
			},

			clickCardLin() {
				if (this.clickLin) {
					this.clickLin = false
					this.nubmLin = "0"
				} else {
					this.nubmLin = ""
					this.clickLin = true
				}
			},
			clickCardYi() {
				if (this.clickYi) {
					this.clickYi = false
					this.nubmYi = "1"
				} else {
					this.nubmYi = ""
					this.clickYi = true
				}
			},
			clickCardEr() {
				if (this.clickEr) {
					this.clickEr = false
					this.nubmEr = "2"
				} else {
					this.nubmEr = ""
					this.clickEr = true
				}
			},
			clickCardSan() {
				if (this.clickSan) {
					this.clickSan = false
					this.nubmSan = "3"
				} else {
					this.nubmSan = ""
					this.clickSan = true
				}
			},
			clickCardSi() {
				if (this.clickSi) {
					this.clickSi = false
					this.nubmSi = "4"
				} else {
					this.nubmSi = ""
					this.clickSi = true
				}
			},
			clickCardWu() {
				if (this.clickWu) {
					this.clickWu = false
					this.nubmWu = "5"
				} else {
					this.nubmWu = ""
					this.clickWu = true
				}
			},
			clickCardLiu() {
				if (this.clickLiu) {
					this.clickLiu = false
					this.nubmLiu = "6"
				} else {
					this.nubmLiu = ""
					this.clickLiu = true
				}
			},
			clickCardQi() {
				if (this.clickQi) {
					this.clickQi = false
					this.nubmQi = "7"
				} else {
					this.nubmQi = ""
					this.clickQi = true
				}
			},
			clickCardBa() {
				if (this.clickBa) {
					this.clickBa = false
					this.nubmBa = "8"
				} else {
					this.nubmBa = ""
					this.clickBa = true
				}
			},
			clickCardJiu() {
				if (this.clickJiu) {
					this.clickJiu = false
					this.nubmJiu = "9"
				} else {
					this.nubmJiu = ""
					this.clickJiu = true
				}
			},
			radioChangeGwei(n) {
				this.geWeiResOdd=n
			},
			radioChangeSwei(n) {
				this.shiWeiResOdd=n
			},
			radioChangeBwei(n) {
				this.baiWeiResOdd=n
			}

		},
		mounted() {


		}
	};
</script>

<style lang="scss">
	view {
		white-space: normal; // 规定段落中的文本不进行换行
		word-break: break-all; // 允许单词中换行，在容器的最右边进行断开不会浪费控件
		word-wrap: break-word; // 防止长单词溢出，单词内部短句
	}
</style>
